package com.nbsaas.boot.project.rest.resource;

import com.nbsaas.boot.project.api.apis.BusinessModelFieldApi;
import com.nbsaas.boot.project.data.entity.BusinessModelField;
import com.nbsaas.boot.project.api.domain.request.BusinessModelFieldRequest;
import com.nbsaas.boot.project.api.domain.response.BusinessModelFieldResponse;
import com.nbsaas.boot.project.api.domain.simple.BusinessModelFieldSimple;
import com.nbsaas.boot.project.rest.convert.BusinessModelFieldSimpleConvert;
import com.nbsaas.boot.project.rest.convert.BusinessModelFieldEntityConvert;
import com.nbsaas.boot.project.rest.convert.BusinessModelFieldResponseConvert;
import com.nbsaas.boot.project.data.repository.BusinessModelFieldRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   业务接口实现
*/
@Transactional
@Service
public class BusinessModelFieldResource extends BaseResource<BusinessModelField,BusinessModelFieldResponse, BusinessModelFieldSimple, BusinessModelFieldRequest>  implements BusinessModelFieldApi {

    @Resource
    private BusinessModelFieldRepository businessModelFieldRepository;

    @Override
    public JpaRepositoryImplementation<BusinessModelField, Serializable> getJpaRepository() {
        return businessModelFieldRepository;
    }

    @Override
    public Function<BusinessModelField, BusinessModelFieldSimple> getConvertSimple() {
        return new BusinessModelFieldSimpleConvert();
    }

    @Override
    public Function<BusinessModelFieldRequest, BusinessModelField> getConvertForm() {
        return new BusinessModelFieldEntityConvert();
    }

    @Override
    public Function<BusinessModelField, BusinessModelFieldResponse> getConvertResponse() {
        return new BusinessModelFieldResponseConvert();
    }




}


